//   RECEIPT_SYNC(0, "回单同步照片"),
//   RECEIPT(1, "回单照片"),
//   ORDER(2, "订单附件"),
//   INVOICE(4, "开票协议"),
//   SIGN_QRCODE(5, "扫码签收照片"),
//   SIGN(6, "签收照片"),
//   REJECT_SIGN(7, "拒签照片");
//   REJECT_RECEIPT_PIC(8, "回单拒签照片");

export const ATTACHMENT_TYPES = {
  RECEIPT_SYNC: 0,
  RECEIPT_PIC: 1,
  ATTACHMENT: 2,
  INVOICE_PROTOCOL_PIC: 4,
  SIGN_QRCODE_PIC: 5,
  SIGN_PIC: 6,
  REJECT_SIGN_PIC: 7,
  REJECT_RECEIPT_PIC: 8
};

export const ABOUT_CODES = {
  JUMP_COMBINED_WAYBILL: -10341
};

export const STATUS_CODES = {
  WAIT_SIGN: 20,
  WAIT_RECEIPT: 30,
  COMPLETED: 40,
  CLOSED: 50
};

/*
address:"收货地址00001"
city:"济宁市"
cityCode:"370800"
contactMobile:"15012326632"
contactName:"收货联系人001"
district:"泗水县"
districtCode:"370831"
location:"117.2574285898902,35.67060048122767"
locationType:0
province:"山东省"
provinceCode:"370000"

*/
export default {
  props: ["value"],
  computed: {
    order () {
      return this.value || {};
    },
    customer () {
      const customer = this.order?.senderInfo || {};
      const { customerName, customerId } = this.order;
      return { ...customer, customerName, customerId };
    },
    consignee () {
      const consignee = this.order?.consigneeInfo || {};
      const { consigneeName, consigneeId } = this.order;
      return { ...consignee, consigneeName, consigneeId };
    },
    fromAddress () {
      const {
        contactName,
        contactMobile,
        province,
        provinceCode,
        city,
        cityCode,
        district,
        districtCode,
        address,
        location,
        locationType
      } = this.order?.fromAddress || {};
      return {
        contactMobile,
        contactName,
        province,
        provinceCode,
        city,
        cityCode,
        district,
        districtCode,
        address,
        location,
        locationType
      };
    },
    fromTime () {
      return this.order.fromTime;
    },
    toAddress () {
      const {
        contactMobile,
        contactName,
        province,
        provinceCode,
        city,
        cityCode,
        district,
        districtCode,
        address,
        location,
        locationType
      } = this.order?.toAddress || {};
      return {
        contactMobile,
        contactName,
        province,
        provinceCode,
        city,
        cityCode,
        district,
        districtCode,
        address,
        location,
        locationType
      };
    },
    toTime () {
      return this.order.toTime;
    },
    customerType () {
      return this.order.customerType;
    }
  }
};
